#include<iostream>

using namespace std;

bool jude(int num){
    int m = num;
    while(m > 0){
        int n = m % 10;
        if(n == 7) return true;
        m /= 10;
    }
    return false;
}

int main(){
    int n;
    cin >> n;
    int count = 0;
    int num = 1;
    int player[4] = {0};
    while(count < n){
        int i = (num - 1) % 4;
        if(num % 7 == 0 || jude(num)){
            // cout << "num:" << num << endl;
            num ++;
            player[i] ++;
            continue;
        }
        num ++;
        count ++;
    }
    for(int i = 0; i < 4; i ++){
        printf("%d\n", player[i]);
    }
    return 0;
}